package com.ysfxt.controller;


import com.ysfxt.model.Evaluate;
import com.ysfxt.result.Result;
import com.ysfxt.service.EvaluateService;
import com.ysfxt.vo.EvaluateParam;
import com.ysfxt.vo.WorksParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ysfxt
 * @since 2024-03-29
 */
@RestController
@RequestMapping("/api/evaluate")
public class EvaluateController {
    @Resource
    private EvaluateService evaluateService;
    
    /**
     * 管理端分页查询
     * @param evaluateParam
     * @return
     */
    @PostMapping("selectEvaluate")
    public Result selectEvaluate(@RequestBody EvaluateParam evaluateParam){
        return evaluateService.selectEvaluate(evaluateParam);
    }
    
    /**
     * 导出
     * @param response
     */
    @GetMapping("exportData")
    public void exportData(HttpServletResponse response){
        evaluateService.exportData(response);
    }
    
    /**
     * 评委老师查看参赛作品列表
     * @param worksParam
     * @return
     */
    @PostMapping("expertReviewList")
    public Result expertReviewList(@RequestBody WorksParam worksParam){
        return evaluateService.expertReviewList(worksParam);
    }
    
    /**
     * 评审 ，前端需要把作品id给发过来
     * @param evaluate
     * @return
     */
    @PostMapping("expertReview")
    public Result expertReview(@RequestBody Evaluate evaluate){
        return evaluateService.expertReview(evaluate);
    }
    
}

